INSERT INTO divisions (name) VALUES ('Division1');
INSERT INTO divisions (name) VALUES ('Division2');
INSERT INTO divisions (name) VALUES ('Division3');
INSERT INTO divisions (name) VALUES ('Division4');
INSERT INTO divisions (name) VALUES ('Division5');

CREATE OR REPLACE FUNCTION loop1()
  RETURNS void AS
$BODY$

DECLARE
i INTEGER := 0;
FirstName_ VARCHAR;
LastName_ VARCHAR;
BEGIN

WHILE i<=2000 LOOP
FirstName_ := 'FirstName_ ' || (i::VARCHAR);
LastName_ := 'LastName_ ' || (i::VARCHAR);
INSERT INTO employees (first_name, last_name, salary, birthdate, active, division_id) VALUES (FirstName_, LastName_, 1298.98, '12.12.1970', '1', '1');
i:=i+1;
END LOOP;
END;
$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;
ALTER FUNCTION loop1() OWNER TO postgres;

SELECT loop1 ();